package com.tledu.springboot01.service.impl;

import com.tledu.springboot01.dao.IUserDao;
import com.tledu.springboot01.mapper.UserMapper;
import com.tledu.springboot01.model.User;
import com.tledu.springboot01.service.IUserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@AllArgsConstructor
public class UserServiceImpl implements IUserService {
    private final IUserDao userDao;
    private final UserMapper userMapper;

    @Override
    public List<User> list() {
        return userMapper.list();
    }

    @Override
    public int add(User user) {
        return userDao.add(user);
    }

    @Override
    public int batchDelete(List<Integer> ids) {
        return userDao.batchDelete(ids);
    }
}
